#include<bits/stdc++.h>
using namespace std;
#define int long long

int cnt[105];

signed main() {
	string s;
	cin >> s;

	int lower_ch = 0, scores_fe = 0;
	int upper_ch = 0, scores_ma = 0;
	for (auto i : s) {
		int scores;
		if (islower(i)) {
			lower_ch++;
			scores = 100 - (i - 'a') * 4;
			scores_fe += scores;
			cnt[scores]++;
		} else {
			upper_ch++;
			scores = 100 - (i - 'A') * 4;
			scores_ma += scores;
			cnt[scores]++;
		}
	}

	int max_score = *max_element(cnt, cnt + 101);
	for (int i = 100; i >= 0; i--) {
		if (cnt[i] == max_score) {
			cout << i << endl;
			break;
		}
	}
	if (upper_ch) {
		cout << fixed << setprecision(2) << 1.0 * scores_ma / upper_ch << endl;
	} else {
		cout << "0.00" << endl;
	}
	if (lower_ch) {
		cout << fixed << setprecision(2) << 1.0 * scores_fe / lower_ch << endl;
	} else {
		cout << "0.00" << endl;
	}
	return 0;
}
